package com.gba.mark.exam.controller;


import com.gba.mark.exam.entity.ExamAnswer;
import com.gba.mark.exam.service.ExamAnswerService;
import com.gba.mark.util.ResponseUtil;
import com.qigetech.utils.resultbundle.ResultBundleBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


   @RestController
   @RequestMapping("/exam/answer")
   public class ExamAnswerController {

       @Autowired
       private ExamAnswerService examAnswerService;

       @Autowired
       private ResultBundleBuilder resultBundleBuilder;

        /**
     * 新建并保存一份用户输入的答案
     */

    @PostMapping("/saveAnswer")
    public ResponseUtil<Integer> update(@RequestBody ExamAnswer examAnswer){

        return new ResponseUtil<>(HttpStatus.OK,examAnswerService.saveAnswer(examAnswer));

    }
}


